﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LINQPad.OpenAccess.Helpers;

namespace LINQPad.OpenAccess.Data
{
    /// <summary>
    /// Predefined connection data
    /// </summary>
    public class PredefinedConnectionData
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PredefinedConnectionData" /> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="connectionString">The connection string.</param>
        /// <param name="providerName">Name of the provider.</param>
        public PredefinedConnectionData( string name, string connectionString, string providerName = null )
        {
            Guard.ArgumentNotNullOrEmpty( name, "name" );
            Guard.ArgumentNotNullOrEmpty( connectionString, "connectionString" );

            this.Name = name;
            this.ConnectionString = connectionString;
            this.ProviderName = providerName ?? String.Empty;
        }

        /// <summary>
        /// Gets the connection string.
        /// </summary>
        /// <value>
        /// The connection string.
        /// </value>
        public string ConnectionString { get; private set; }
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; private set; }
        /// <summary>
        /// Gets the name of the provider.
        /// </summary>
        /// <value>
        /// The name of the provider.
        /// </value>
        public string ProviderName { get; private set; }
    }
}
